package com.zb.order.controller;


import com.zb.order.service.ConWorkSpareReturnService;
import com.zb.result.Result;
import com.zb.service.ZjWorkSpareReturnService;
import com.zb.utils.TokenUtil;
import com.zb.vo.WorkSpareReturnSelectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

/**
 * <p>
 * 工单备件旧件退回表 前端控制器
 * </p>
 *
 * @author WEN
 * @since 2023-10-30
 */
@Api(tags = "工单备件旧件退回类接口")
@RestController
@RequestMapping("/work/spare/return")
public class ZjWorkSpareReturnController {
    @Resource
    private ConWorkSpareReturnService conWorkSpareReturnService;
    @Resource
    private ZjWorkSpareReturnService workSpareReturnService;

    @ApiOperation("获取工单备件旧件列表")
    @PostMapping("/getList")
    public Result getList(HttpServletRequest request, @RequestBody @Valid WorkSpareReturnSelectVo selectVo) {
        Long custAccId = TokenUtil.getcustAccIdByToken(request);
        return Result.success("获取工单备件旧件列表成功").data(conWorkSpareReturnService.getList(custAccId, selectVo));
    }

}
